/*
 * 작성일 : 2014. 4. 10.
 * 작성자 : hch1982
 *
 * 설명
*/ 
/**
 * 
 */
package springbook.temp;

import java.io.IOException;

import javax.servlet.ServletException;

import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;

/**
 * @author hch1982
 *
 * 코드 수정 히스토리
 * 날짜		작업자		태그
 * 2014. 4. 10.	hch1982	
 */
public class MockTest {
	public static void main(String [] args){
		MockHttpServletRequest req = new MockHttpServletRequest("GET", "/hello");
		req.addParameter("name", "Spring");
		
		MockHttpServletResponse res = new MockHttpServletResponse();
		SimpleGetServlet servlet = new SimpleGetServlet();
		
		try {
			servlet.service(req, res);
			
			System.out.println("output : "+res.getContentAsString() );
		} catch (ServletException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
	}
}
